﻿Ext.override(Ext.Container, {
    applyDefaults: function (c) {
        if (this.defaults) {
            if (typeof c == 'string') {
                c = Ext.ComponentMgr.get(c);
            }
            if (!c.events) {
                Ext.applyIf(c, this.defaults);
            } else {
                var ic = c.initialConfig;
                if (ic) {
                    for (var p in this.defaults) {
                        if (ic[p] === undefined) {
                            c[p] = this.defaults[p];
                        }
                    }
                } else {
                    Ext.apply(c, this.defaults);
                }
            }
        }
        return c;
    }
});

Ext.util.JSON.encodeDate = function (o) {
    var ticks = o.getTime();
    var formattedDate = 'new Date(' + ticks + ')';
    return formattedDate;
};
